package org.oop1.jicheng;

public class Demo3 {
	private String schoolName;
	private String name;
	private int age;
	public Demo3(){
		
	}
	//虽然构造方法也能对私有属性进行初始化赋值，但是只能在本类中访问
	public Demo3(String sn,String na,int ag){
		this.schoolName = sn;
		this.name = na;
		this.age = ag;
	}
	public void setSchoolName(String sn){
		this.schoolName = sn;
	}
	public String getSchoolName(){
		return schoolName;
	}
	public static void main(String[] args){
		Demo3 do4 = new Demo3("希望幼儿园","小华",4);
		System.out.println(do4.name+do4.age+"要在"+do4.schoolName+"读幼儿园");
	}
	@Override
	public String toString() {
		return "Demo3 [schoolName=" + schoolName + ", name=" + name + ", age=" + age + "]";
	}
	
}
